The present application relates generally to an improved data processing apparatus and method and more specifically to an apparatus and method for processing a plurality of requests simultaneously in a Web application.
Changing trends in the use of World Wide Web technology and Web design that aim to enhance creativity, communications, secure information sharing, collaboration, and functionality of the Web has had an enormous impact on the Internet. Web applications are much more responsive thanks to Web development techniques, such as Asynchronous JavaScript and XML (Ajax), reverse Ajax, or the like. Web pages that use Ajax are more responsive and interactive because they exchange small amounts of data with the server “behind the scenes” so that the entire Web page does not have to be reloaded each time there is a need to fetch data from the server. Reverse Ajax (or Comet) leaves open a connection to the server so that the server can send data to the client as soon as it is available.
The more a Web page utilizes techniques such as Ajax and Comet, the more responsive and rich it will be. For instance, a Web page that uses one Ajax request to fetch data for an entire table will not be as up to date or as interactive as a Web page that uses many Comet style connections to fetch data for each row or each cell in the table as soon as new data is available. The problem with using these techniques is that the Hypertext Transfer Protocol (HTTP) 1.1 specification states that “A single-user client should not maintain more than 2 connections with any server or proxy” and this recommendation is followed by most browsers, including Internet Explorer, and the like.
The two connection limit issue means that holding one connection open for Comet can therefore impact performance. The browser may be unable to send a new user-initiated Ajax request while the browser loads, for example, a series of images. Another problem arises if a Web page uses Ajax to retrieve many pieces of information from the server at the same time. Imagine a systems management application that uses Ajax to fetch the status of twenty different machines in a table. The Web page would only be able to retrieve two status values at any given time because of the two connection limit issue.
Ajax and Comet are two very useful techniques that allow for the creation of very rich internet applications. However, the two HTTP connection limit issue means that these techniques have to be used carefully and sparingly at times. Many JavaScript™ libraries exist that utilize Ajax, two major libraries being Prototype and Dojo. Neither toolkit allows more than one outstanding Ajax request from the client at a time. The following paragraph from the Alternatives section of the Comet Wikipedia® page talks more about alternatives that are available:                “Instead of using browser-native technologies to provide persistent connections, some developers instead turn to plugins, such as Java applets or the proprietary Adobe Flash. These have the advantage of working identically across all browsers with the appropriate plugin installed, need not use HTTP connections, and face none of the security restrictions placed on browser-native transports. These strengths, however, are also the main drawbacks of proprietary plugins: not all clients have the plugins installed—for instance, the Apple iPhone includes neither—and the use of protocols other than HTTP, and ports other than port 80, can cause them to be blocked by firewalls.”        